package com.itheima.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter//只是get方法的注解
public enum GenderEnums {
    MALE(1,"男"),
    FEMALE(2,"女");
@EnumValue//标记数据库中存的值是code
@JsonValue //jackson 转成json字符串使用code值为对象属性的值
    private Integer code;
    private String message;

    GenderEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
